<extend name="Base/common_nojhd"/>
<block name="TITLE"><title>世果代购</title></block>
<block name="body">    
      <header data-am-widget="header" class="am-header am-header-default am-header-fixed">
        <div class="am-header-left am-header-nav">
            <a href="{:U('index/index')}" class="">
                <i class="am-header-icon am-icon-home"></i>
            </a>
        </div>
        <h1 class="am-header-title">
            <a href="#title-link" class="">
               我的代购
            </a>
        </h1>
        <div class="am-header-right am-header-nav">
        </div>
    </header>
    <volist name="historyList" id="list" empty="您还没有代购记录">       
        <div class="am-panel am-panel-secondary">
        <div class="am-panel-hd">
             <h3 class="am-panel-title">单号:{$list.orderid}</h3>
        </div>
        <div class="am-panel-bd">
          <p>{$list.user_addr},{$list.user_tel}</p>
             {$list.describe}
        </div>
        <table class="am-table am-table-striped am-table-compact am-table-bordered">
            <thead>
                <tr >
                    <th>商品</th>
                    <th>数量</th>
                </tr>
            </thead>
            <tbody> 
                <volist name="list.good_details" id="goods" key='i'>                    
                    <eq name="goods.orderid" value="$list['orderid']">                        
                        <tr>
                            <td>{$goods.pname}</td>
                            <td>{$goods.num}</td>
                        </tr>                     
                    </eq> 
                </volist>               
                <tr>
                    <td colspan="2" align="right">
                              <span class="am-text-danger">{$list.status|get_order_status}</span>            
                    </td>
                   
                </tr>
            </tbody>
        </table>
        <div class="am-panel-footer">
            创建时间:{$list.create_time|time_format}
                <eq name="list.status" value="1000">         
                    <a class="  am-btn  am-btn-danger" href="{:U('Agent/cancelOrder',array('id'=>$list['orderid']))}" onclick='return cancel();'>撤销</a>                            
                </eq> 
        </div>
      </div>
    </div>
    </volist>   
    <script>
        function cancel()
        {
            if(confirm("确定要取消订单吗？")){
                return true;
            }else{
                return false;
            }
        }
    </script>
</block>